package homework;

/**
 * @ClassName Person
 * @Description TODO
 * @Author 黑白灰色雨
 * @Date 2024/8/26 15:34
 * @Version 1.0
 */
public class Person {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        if(age<0||age>100){
            System.out.println("年龄不合法！");
        }else {
            System.out.println("年龄合法！");
        }
    }

}
